package com.hymall.controller.wx;

import com.hymall.bean.MarketCollect;
import com.hymall.bean.MarketUser;
import com.hymall.bean.common.BasePageInfo;
import com.hymall.bean.common.BaseRespVo;
import com.hymall.bean.common.CommonData;
import com.hymall.service.wx.WxCollectService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * @author: 周子伟
 * @description ${}
 * @date: 2022/7/19 14:28
 */

@RestController
@RequestMapping("/wx/collect")
public class WxCollectController {


    @Autowired
    WxCollectService wxCollectService;


    /*
    * @author Invoker
    * @description {收藏功能}
    * @date 2022/7/19 16:40
    * @param
    * @return
    */

    @PostMapping("addordelete")

    public BaseRespVo addordelete(@RequestBody MarketCollect marketCollect) {

       wxCollectService.addordelete(marketCollect);


        return BaseRespVo.ok(null);

    }


    @GetMapping("list")
    public  BaseRespVo list(Byte type,BasePageInfo info){


    CommonData data= wxCollectService.listAllCollect(type, info);

        return  BaseRespVo.ok(data);
    }



}
